package com.szbmyoubao.app.view.image

import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatImageView
import com.ellecity06.cwhiskymall.R

/**
 * @author ellecity06
 * @time 2025/3/12 17:08
 * @des
 */
class CheckImage @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : AppCompatImageView(context, attrs, defStyleAttr) {
    var checked: Boolean = false
        private set

    init {
        setOnClickListener {
            checked = !checked
            setState()
        }
        setState()
    }

    private fun setState() {
//        setImageResource(if (checked) R.mipmap.btn_cho else R.mipmap.btn_pre_cho)
    }
}